package com.aabte.design.pattern.structural.decorator.v2;

public class Test {

    public static void main(String[] args) {

        AbstractBattercake battercake = new Battercake();
        BattercakeDecorator battercakeDecorator = null;
        battercakeDecorator = new EggDecorator(battercake);
        battercakeDecorator = new EggDecorator(battercakeDecorator);
        battercakeDecorator = new SausageDecorator(battercakeDecorator);
        System.out.println(battercakeDecorator.getDesc() + "价格：" + battercakeDecorator.getCost());


        AbstractBattercake shandongBattercake = new ShandongBattercake();
        BattercakeDecorator shandongBattercakeDecorator = null;
        shandongBattercakeDecorator = new EggDecorator(shandongBattercake);
        shandongBattercakeDecorator = new EggDecorator(shandongBattercakeDecorator);
        shandongBattercakeDecorator = new SausageDecorator(shandongBattercakeDecorator);
        System.out.println(shandongBattercakeDecorator.getDesc() + "价格：" + shandongBattercakeDecorator.getCost());

    }

}
